package com.ds.infrastructure.hyperspace.console.entity.enums;

/**
 * @author: yaozhendong
 * @create: 2019-09-17 14:51
 **/
public interface TbPublicEnum {
    /**
     * 是否删除
     */
    enum GMD_IS_DEL {
        NO(1, "否：有效数据"),
        YES(2, "是：无效数据");

        public final Integer code;
        private final String desc;

        GMD_IS_DEL(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }
    }

    /**
     * 状态
     */
    enum ID_VALUE {
        DEFAULT(0L, "ID默认值");

        public final Long value;
        private final String desc;

        ID_VALUE(Long value, String desc) {
            this.value = value;
            this.desc = desc;
        }
    }

    /**
     * ORDER BY 类型
     */
    enum ORDER_BY_TYPE {
        ID_DESC(1, "order by id desc"),
        ID_ASC(2, "order by id asc");

        public final Integer value;
        private final String desc;

        ORDER_BY_TYPE(Integer value, String desc) {
            this.value = value;
            this.desc = desc;
        }
    }

    /**
     * 任务-状态
     */
    enum TASK_COMPLETE_STATE {
        INIT(1, "初始化:待确认"),
        COMPLETE(2, "完成：已确认");

        public final Integer value;
        private final String desc;

        TASK_COMPLETE_STATE(Integer value, String desc) {
            this.value = value;
            this.desc = desc;
        }

        public static TASK_COMPLETE_STATE toEnum(int value) {
            for (TASK_COMPLETE_STATE item : TASK_COMPLETE_STATE.values()) {
                if (item.value == value) {
                    return item;
                }
            }
            return null;
        }
    }

    enum METRICS_VALUE {
        DEFAULT(-1L, "ID默认值");

        public final Long value;
        private final String desc;

        METRICS_VALUE(Long value, String desc) {
            this.value = value;
            this.desc = desc;
        }
    }
}
